console.log("被执行了！");
// var port_background_contet_script = chrome.runtime.connect({name: "background_contet_script"});
// var port_content_script_popup = chrome.runtime.connect({name: "content_script_popup"});

// port_background_contet_script.onMessage.addListener(function(msg) {
//   console.log('content_script收到： '+msg)

//   port_content_script_popup.postMessage("已经收到消息："+msg);
// });
// var img_list = document.createDocumentFragment();
// chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {sendResponse("回复"); });
chrome.runtime.onConnect.addListener(port => {
	if(port.name == 'get_img_req') {
		port.onMessage.addListener(msg => {
			var ele_img = document.createElement('img');
			ele_img.src = msg;
			getImgsContain().appendChild(ele_img);
		})
	}
})
var ele_img_list = '';
function getImgsContain() {
	if(!ele_img_list){
		ele_img_list = document.createElement('div');
		ele_img_list.id = 'mychromeImgs';
		document.body.appendChild(ele_img_list);
	}
	return ele_img_list;
}
function addImgs(img_url) {
	console.log(img_url);
	// imgs_contain
}